<?php
$includePaths = array(
	CN_APPLICATION_PATH,
	get_include_path()
);
set_include_path(implode(PATH_SEPARATOR, $includePaths));

require_once 'application/constants.php';
require_once 'application/functions/helpers.php';
require_once 'application/functions/query.php';

// Initialize concerto;
function __autoload($class) {
	$filename = str_replace('\\', '/', $class) . '.php';
	$namespace = explode('\\', $class);
	if($namespace[1] == 'datatypes' && Modulator()->getDataTypePath($namespace[2])) {
		
		require_once (Modulator()->getDataTypePath($namespace[2]));
	}
	elseif($namespace[1] == 'admin' && $namespace[2] == 'panels' && Modulator()->getPanelPath($namespace[3])) {
		require_once (Modulator()->getPanelPath($namespace[3]));
	}	
	elseif(file_exists(CN_APPLICATION_PATH . $filename)) require_once ($filename);
	
	// Custom data types. Note that this is safe because datatypes are never called before Modulator is initialize
	
	else {
		echo 'could not find class '.$class;
	}
}

$concerto = new \application\system\Concerto;
$concerto->goMin();
?>